/*
* Copyright (c)  2017, ueboot.com
* All rights reserved.
* 2017-11-05 18:13:23
*/
package com.ueboot.weishop.service.goods;

import com.ueboot.weishop.entity.goods.GoodsSalesSpecEntity;
import com.ueboot.core.service.BaseService;
import org.springframework.data.domain.Page;
import org.springframework.data.domain.Pageable;

import java.io.InputStream;
import java.util.List;

/**
 * Created by yangkui  on 2017-11-05 18:13:23.
 *
 * @author yangkui
 * @since 2.0 by autocode
 */
public interface GoodsSalesSpecService extends BaseService<GoodsSalesSpecEntity> {

    /***
     *
     * @param specValueFullPathValue
     * @return
     */
    List<GoodsSalesSpecEntity> findSpec(String specValueFullPathValue);

    /**
     * 根据商品ID查询销售规格
     *
     * @param pageable
     * @param goodsInfoId
     * @return
     */
    Page<GoodsSalesSpecEntity> findByGoodsInfoId(Pageable pageable, Long goodsInfoId);


    List<GoodsSalesSpecEntity> findSpecAndName(String specValueFullPathValue, String name);

    /**
     * 导入文件
     *
     * @param goodsInfoId
     * @param in
     */
    void importSalesSpec(Long goodsInfoId, InputStream in);

    /**
     * 根据商品ID，删除所有商品的价格数据
     *
     * @param goodsInfoId 商品ID
     */
    void deleteGoodsSalesSpecEntitiesByGoodsInfoId(Long goodsInfoId);

    List<GoodsSalesSpecEntity> findSpecAndGoodsId(String specValueFullPathValue, Long goodsInfoId);
    GoodsSalesSpecEntity findById(Long id);

}
